// import store,{addGoods,joinCart} from "./store";
import store from "./store";
import {addGoods} from "./store/slice/goods";
import {joinCart} from "./store/slice/cart";
// 操作数据
store.subscribe(function(){
    console.log(store.getState());
})

// 添加商品
store.dispatch(addGoods({goodsName:"笔记本",goodsPrice:1000}));
store.dispatch(addGoods({goodsName:"鼠标",goodsPrice:10}));
// 将商品放置到购物车
const {goodsList} = store.getState().goods;
store.dispatch(joinCart(goodsList[0]))
store.dispatch(joinCart(goodsList[1]))
store.dispatch(joinCart(goodsList[0]))
store.dispatch(joinCart(goodsList[0]))
